<?php
		include ("session.inc");
		require "dbconn.inc";
		$uid=$_SESSION["curid"]; 
		$username=$_SESSION["user"];
		$dbconnection=$_SESSION["dbconnection"];		
	if(session_is_registered("dbconnection") )
	{
			$kingname=trim($_REQUEST['kingname']);
			$data=mysql_query("select  pn_id from mlm_master  where c_username='$kingname' ");
			if($vip=mysql_fetch_array($data)){
			$kingid=$vip['pn_id'];
			$status=true;
		}
		else
		{
			$errormessage="Username not existing";
		}
		if($status){
			if($kingid<$uid){
			$errormessage="Sorry ! you don't have the Permission to view this information";
		}
		else{
			$searchid=base64_encode($kingid);
			header("location:geneology.php?sdWfbbTEfjiopOrungSHyiRD=$searchid");
		}
		}
?><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="57%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#669933"><div align="CENTER"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><?php echo $errormessage ?></font> </div></td>
  </tr>
</table>
<?php
		}
		else
		{
		$errormsg="Session expired";
		header("location:login.php?error=$errormsg");
		}
?>